<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <a href="index.html">首页</a>	<br>
        <form action="#">
                用户名: <input type="text" name="uname">
                密码：<input type="password" name="password">
                <input type="submit" value="提交">
            </form>
        
            <ul>
                <li><a href="">item1</a></li>
                <li><a href="">item2</a></li>
                <li><a href="">item3</a></li>
                <li><a href="">item4</a></li>
            </ul>
            
            <img src="">
            <img src="">
            <img src="">
            <img src="">
    <script>
        console.log(document.links)
		console.log(document.forms)
		console.log(document.images)
		console.log(screen)
		console.log(navigator.userAgent.search(/Chrome/ ))

        // 弹出对话框
        alert("我有弹出内容和确定按钮")
        // 确认对话框，确认框和取消按钮，确认返回true,取消返回false
        if(confirm('确定是否要删除？')){
            alert('执行删除.....')
        }
        // 输入对话框
        var name;
        if((name=prompt("请输入你的名字","老师"))!=null){
            alert('welcome')
        }
        // window.open('http://www.baidu.com');
        var info =navigator.userAgent;
    // console.log(info);

    // console.log(navigator.userAgent.search(/Chrome/));
    //弹出当前浏览器名称
        document.write(info);
        console.log(info.search(/Chrome/));
        console.log(info.search(/Firefox/));
        function brow(){

        if(info.search(/Chrome/)>=0){
     alert('您使用的是谷歌浏览器')
        }else if(info.search(/Firefox/)){
            alert('您使用的是火狐浏览器')
        }
     }
        brow();
    </script>
</body>
</html>